<template>
  <el-card shadow="never" class="aui-card--fill">
    <div class="mod-demo__xlsusersdraws}">
      <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
        <el-form-item>
          <el-input v-model="dataForm.id" placeholder="id" clearable></el-input>
        </el-form-item>
        <el-form-item>
          <el-button @click="getDataList()">{{ $t('query') }}</el-button>
        </el-form-item>
      </el-form>
      <el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;">
        <el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
        <!-- <el-table-column prop="id" label="提现记录Id" header-align="center" align="center"></el-table-column> -->
        <el-table-column prop="drawNo" label="提现订单号" header-align="center" align="center"></el-table-column>
		<el-table-column prop="createTime" label="创建时间" header-align="center" align="center"></el-table-column>
        <el-table-column prop="username" label="用户名称" header-align="center" align="center"></el-table-column>
		<el-table-column prop="type" label="提现类型" header-align="center" align="center">
			<template slot-scope="scope">
				<!--提现类型 1.银行卡2.支付宝3.微信 4.消费钱包5,奖励账户-->
			  {{scope.row.type === 1 ? '银行卡' :
			    scope.row.type === 2 ? '支付宝' :
				scope.row.type === 3 ? '微信' :
				scope.row.type === 4 ? '消费钱包' :
				scope.row.type === 5 ? '奖励账户' : ''
				 }}
			</template>
		</el-table-column>
		<el-table-column prop="cash" label="申请提现金额" header-align="center" align="center"></el-table-column>
        <el-table-column prop="accNo" label="银行卡号" header-align="center" align="center"></el-table-column>
		<el-table-column prop="bankName" label="开户行" header-align="center" align="center"></el-table-column>
        <el-table-column prop="mobile" label="用户手机号" header-align="center" align="center"></el-table-column>
        <el-table-column prop="cashStatus" label="提现状态" header-align="center" align="center">
			<template slot-scope="scope">
				<!--提现状态 -2受理失败 -1审核拒绝 0审核中 2受理中 3受理成功 4线下打款-->
			  {{
				scope.row.cashStatus === -2 ? '受理失败' :
				scope.row.cashStatus === -1 ? '审核拒绝' :
				scope.row.cashStatus === 0 ? '审核中' :
			    scope.row.cashStatus === 2 ? '受理中' :
				scope.row.cashStatus === 3 ? '受理成功' :
				scope.row.cashStatus === 4 ? '线下打款' : ''
				 }}
			</template>
		</el-table-column>
        <el-table-column prop="checkRemark" label="拒绝理由" header-align="center" align="center"></el-table-column>
        <el-table-column prop="sysUserName" label="审核员工" header-align="center" align="center"></el-table-column>
        <el-table-column prop="checkTime" label="审核时间" header-align="center" align="center"></el-table-column>
        <el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
          <template slot-scope="scope">
            <el-button v-if="$hasPermission('demo:xlsusersdraws:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">查看详情</el-button>
          </template>
        </el-table-column>
      </el-table>
      <el-pagination
        :current-page="page"
        :page-sizes="[10, 20, 50, 100]"
        :page-size="limit"
        :total="total"
        layout="total, sizes, prev, pager, next, jumper"
        @size-change="pageSizeChangeHandle"
        @current-change="pageCurrentChangeHandle">
      </el-pagination>
      <!-- 弹窗, 新增 / 修改 -->
      <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
    </div>
  </el-card>
</template>

<script>
import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './xlsusersdraws-add-or-update'
export default {
  mixins: [mixinViewModule],
  data () {
    return {
      mixinViewModuleOptions: {
        getDataListURL: '/demo/xlsusersdraws/page',
        getDataListIsPage: true,
        exportURL: '/demo/xlsusersdraws/export',
        deleteURL: '/demo/xlsusersdraws',
        deleteIsBatch: true
      },
      dataForm: {
        id: ''
      }
    }
  },
  components: {
    AddOrUpdate
  }
}
</script>
